#include <gui/GuiSDL.h>
#include <SDL3/SDL.h>
#include <imgui_impl_sdlrenderer3.h>
#include <imgui_impl_sdl3.h>

primary::GuiSDL::GuiSDL(SDL_Window* window, SDL_Renderer* render) : GuiBase{}
{
	ImGui_ImplSDL3_InitForOther(window);
	ImGui_ImplSDLRenderer3_Init(render);
}

primary::GuiSDL::~GuiSDL()
{
	ImGui_ImplSDLRenderer3_Shutdown();
	ImGui_ImplSDL3_Shutdown();
}

void primary::GuiSDL::process(SDL_Event* e)
{
	ImGui_ImplSDL3_ProcessEvent(e);
}

void primary::GuiSDL::new_frame()
{
	ImGui_ImplSDLRenderer3_NewFrame();
	ImGui_ImplSDL3_NewFrame();
	ImGui::NewFrame();
}

void primary::GuiSDL::draw()
{
	ImGui_ImplSDLRenderer3_RenderDrawData(ImGui::GetDrawData());
}
